import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;

public class aa {
    public static void main(String[] args) {
        Random a = new Random();
        Random c = new Random();
        int r = (int) (Math.random() * 5) + 1;
        int d[] = new int[r];
        for (int i = 0; i < d.length - 1; i++) {
            d[i] = (int) (Math.random() * 10);
            Arrays.sort(d);
        }
        System.out.println(Arrays.toString(d));

        for (int i = d.length-1; i >= 0; i--) {
           d[0]=d[i];
             }
        System.out.println(Arrays.toString(d));

    }
}